home *** CD-ROM | disk | FTP | other *** search
- Path: hermes.oc.com!usenet
- From: Larry Weiss <lfw@oc.com>
- Newsgroups: comp.lang.c
- Subject: Re: MACROS with varying number of parameters
- Date: Thu, 15 Feb 1996 16:05:14 -0600
- Organization: OpenConnect Systems, Dallas, TX, USA
- Message-ID: <3123AE1A.5133@oc.com>
- References: <freedmanj-1502961337370001@155.95.68.41>
- NNTP-Posting-Host: ocs2228.oc.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
- CC: lfw@oc.com
-
- Jerry Freedman wrote:
- >
- > A while back I saw a trick for writing macros with a variable number of
- > paramters. Its very useful for debugging stuff like
- >
- > #ifdef
- > #define DEBUG_PRINT(some parameters) printf(parameters)
- > #else
- > #define DEBUG_PRINT(some_parameters)
- > #endif
- >
- > Unfortunately, I lost it. I'd like to see it again,
- >
-
- Why not just pass the entire printf() expression to the macro
- and let it use it. Have you coded a complete example of what you'd
- like to do?
-